package com.learn.mvc.action;

import com.learn.mvc.pojo.BaseForm;
import com.learn.mvc.pojo.UserForm;

public class LoginAction implements Action {

	@Override
	public String execute(BaseForm form) {
		if (form == null) {
			return "fail";
		}
		UserForm user = (UserForm) form;
		if ("john".equals(user.getUserName()) && "john".equals(user.getPassword())) {
			return "success";
		}

		return "fail";
	}

}
